package com.liuyi.netty.im.lychat.modular.controller.model;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import java.io.Serializable;

/**
 * @author Mr.Fmy
 * @since 2021/12/29
 */
public class UserModel {

    @Data
    @ApiModel("UserModel-Registered")
    public static class Registered implements Serializable {

        @ApiModelProperty(value = "用户名", required = true)
        @NotEmpty
        @Length(max = 11, message = "用户名最长11位")
        private String username;

        @ApiModelProperty(value = "密码", required = true)
        @NotEmpty
        private String password;

    }

    @Data
    @ApiModel("UserModel-Login")
    public static class Login implements Serializable {

        @ApiModelProperty(value = "用户名", required = true)
        @NotEmpty
        private String username;

        @ApiModelProperty(value = "密码", required = true)
        @NotEmpty
        private String password;
    }
}
